#pragma once
#include "stdafx.h"
#include <vector>
#include <opencv2/imgproc/imgproc_c.h>
using namespace std;

class CMuti_Kernel
{
public:
	CMuti_Kernel(void);
	~CMuti_Kernel(void);
	void solveMaxMin4MKL2(float *init_beta, vector<CString> &kernelFNs, vector<int> &modes, vector<int> inds, vector<int> labels, CString rstFN, float thres_C);
	void solveMaxMin4GSMKL4(float *init_beta, vector<CString> &kernelFNs, vector<int> &modes, vector<int> inds, vector<int> labels, vector<int> groups, int G, CString rstFN);
private:
	int myMosekSVM(float **p_H, double * p_X, vector<int> &labels, int size, double cur_thres);
	int myMosekSVM2(double **p_H, double * p_X, vector<int> &labels, int size, double cur_thres);
	float estimateB4MKL(vector<float **> &kernels, vector<int> &labels, vector<float> &beta, int size, double *delta, float thres);
};

float Unified1vsRMultiLabeling4Cache(CString logFN, float *init_beta, int train_mode, int G, int numClass, CString trainGroupFN, CString testGroupFN, CString labelFN, int cate, 
									 int train_num, int test_num, CString dir, vector<CString> &kernelFNs, vector<CString> &simMatFNs, CString tLabelFN, bool isUMK);
